
package net.sea.setup.enums;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import net.sea.commons.constants.AppConstants;

/**
 * 
 * 配置映射
 *
 * @author huachengwu 
 */
@SuppressWarnings("serial")
public enum CfgMapping {
	/**
	 * 数据库映射
	 */
	DbCfg(Collections.unmodifiableMap(new HashMap<String, String>() {
		{
			put(AppConstants.DB_URL, "c3p0.url");
			put(AppConstants.DB_USER, "c3p0.user");
			put(AppConstants.DB_PWD, "c3p0.password");
			put(AppConstants.DB_DRIVER_CLASS, "c3p0.driverClass");
		}
	})), 
	/**
	 * 服务端文件地址配置映射
	 */
	ServerFileCfg(Collections.unmodifiableMap(new HashMap<String, String>() {
		{
			put(AppConstants.SERVER_CHART_PATH, "designChartPath");
			put(AppConstants.SERVER_IMG_PATH, "imagePath");
			put(AppConstants.SERVER_LOG_PATH, "logfile");
		}
	})),
	/**
	 * 服务端服务器发布配置映射
	 */
	ServerReleaseCfgOfServer(Collections.unmodifiableMap(new HashMap<String, String>() {
		{
			put(AppConstants.SERVER_RELEASE_ADDRESS, "dubbo.registry.address");
			put(AppConstants.SERVER_RELEASE_ADDRESS_PORT, "dubbo.protocol.port");
		}
	})),
	/**
	 * 客户端服务器发布配置映射
	 */
	ServerReleaseCfgOfClient(Collections.unmodifiableMap(new HashMap<String, String>() {
		{
			put(AppConstants.CLIENT_RELEASE_ADDRESS, "dubbo.registry.address");
		}
	})),
	/**
	 * 执行机配置映射
	 */
	EMCfg(Collections.unmodifiableMap(new HashMap<String, String>() {
		{
			put(AppConstants.DB_URL, "db.url");
			put(AppConstants.DB_USER, "db.user");
			put(AppConstants.DB_PWD, "db.password");
			put(AppConstants.DB_DRIVER_CLASS, "db.driverClass");
			put(AppConstants.EM_CASE_DOWN_DIR, "caseDownPath");
			put(AppConstants.EM_FTP_IP, "ftpIp");
			put(AppConstants.EM_FTP_PORT, "ftpPort");
			put(AppConstants.EM_FTP_USER, "ftpUser");
			put(AppConstants.EM_FTP_PWD, "ftpPass");
		}
	}))
	;
	
	private Map<String, String> mapping;

	private CfgMapping(Map<String, String> mapping) {
		this.mapping = mapping;
	}

	public Map<String, String> getMapping() {
		return mapping;
	}

	public void setMapping(Map<String, String> mapping) {
		this.mapping = mapping;
	}

}

/*
 * 修改历史 $Log$
 */